<script src="@/js/culture/bagua.js"></script>

<template>
  <div class="bagua" id="app">
    <div class="margins">

      <!-- 导航 -->
      <el-affix>
        <div class="affix">
          <Breadcrumb separator=">">
            <span v-for="item in navigations" :key="item">
              <BreadcrumbItem :to="item.link">
                <Icon :type="item.icon" />
                {{ item.title }}
              </BreadcrumbItem>
            </span>
          </Breadcrumb>
        </div>
        <div class="divider">
          <el-divider />
        </div>
      </el-affix>

      <!-- 数据 -->
      <div class="data">

        <el-row :gutter="15">
          <el-col :span="21">
            <el-card shadow="always" class="card1">

              <el-row :gutter="40">
                <el-col :span="12">
                  <el-card shadow="never" class="option-card">
                    <div class="title" @click="pageTable = 0">
                      基本介绍
                      <span v-show="pageTable === 0">
                        <Icon type="ios-arrow-dropdown-circle" />
                      </span>
                    </div>
                  </el-card>
                </el-col>
                <el-col :span="12">
                  <el-card shadow="never" class="option-card">
                    <div class="title" @click="pageTable = 1">
                      详细解读
                      <span v-show="pageTable === 1">
                        <Icon type="ios-arrow-dropdown-circle" />
                      </span>
                    </div>
                  </el-card>
                </el-col>
              </el-row>

              <div class="content">
                <div v-show="pageTable === 0">

                  <div>
                    <el-tag round type="info" effect="dark">
                      <span>古文献参考</span>
                    </el-tag>
                  </div>
                  <div>
                    <div>
                      <b>《易传 · 系辞上传》</b>
                      中记载：“易有太极，是生两仪，两仪生四象，四象生八卦。”。
                    </div>
                  </div>
                  <br />
                  <div>
                    <el-tag round type="info" effect="dark">
                      <span>何谓八卦？</span>
                    </el-tag>
                  </div>
                  <div>
                    八卦是一套用三组阴阳组成的形而上的哲学符号，其深邃的哲理解释自然、社会现象。八卦成列，象在其中矣；因而重之，爻在其中矣；刚柔相推，变在其中矣；系辞焉而命之，动在其中矣。
                  </div>
                  <br />
                  <div>
                    <el-tag round type="info" effect="dark">
                      <span>八卦的起源</span>
                    </el-tag>
                  </div>
                  <div>
                    <div>
                      八卦可以追溯到古代中国的易经文化，易经是一部哲学典籍，记录了关于自然、宇宙、人生的观察和思考，以及变化和运行规律的理论。
                    </div>
                  </div>
                  <br />
                  <div>
                    <el-tag round type="info" effect="dark">
                      <span>八卦的形成</span>
                    </el-tag>
                  </div>
                  <div>
                    <div>
                      传说是伏羲观察自然和人类的变化，并将它们记录在八个符号中，这些符号成为了八卦，分别是：乾（☰）、兑（☱）、离（☲）、震（☳）、巽（☴）、坎（☵）、艮（☶）、坤（☷）。
                    </div>
                  </div>

                </div>
                <div v-show="pageTable === 1">

                  <div>
                    <span>
                      <el-autocomplete size="small" maxlength="1" show-word-limit value-key="name" :debounce="300"
                        v-model="queryData" :fetch-suggestions="querySearch" @click.native="pageData2" clearable
                        placeholder="请输入八卦名称（如：坎）" style="width:260px;">
                        <template #prefix>
                          <el-icon class="el-input__icon">
                            <search />
                          </el-icon>
                        </template>
                        <template #default="{ item }">
                          <span v-html="brightenKeyword(item.name, queryData) "></span> <!-- 数据高亮 -->
                        </template>
                      </el-autocomplete>
                    </span>
                    <span>
                      &nbsp;
                      <Button size="small" icon="ios-search" @click="">搜索</Button>
                    </span>
                    <span class="page">
                      <el-pagination small background class="pageList" :pager-count="3"
                        :page-sizes="[10, 20, 30, 50, 100]" layout="total, sizes, prev, pager, next, jumper"
                        :total="dataTotal" :current-page.sync="page" :page-size="pageSize"
                        @size-change="handleSizeChange" @current-change="handleCurrentChange">
                      </el-pagination>
                    </span>
                  </div>

                  <div class="divider">
                    <el-divider />
                  </div>

                  <div v-show="data && data.length !== 0">
                    <div v-for="item in data" :key="item" class="for">
                      <el-card shadow="hover">
                        <div class="name">【<b v-html="showDataMethod(item.name)"></b>】</div>
                        <div>
                          <b>卦象：</b>
                          {{ item.guaAs }}
                        </div>
                        <div>
                          <b>取数： </b>
                          {{ item.quShu }}
                        </div>
                        <div>
                          <b>含义： </b>
                          {{ item.meaning }}
                        </div>
                        <div>
                          <b>相生： </b>
                          {{ item.xiangSheng }}
                        </div>
                        <div>
                          <b>相克： </b>
                          {{ item.xiangKe }}
                        </div>
                        <div v-if="null !== item.biHe">
                          <b>比和： </b>
                          {{ item.biHe }}
                        </div>
                        <div>
                          <b>旺衰： </b>
                          {{ item.jiJieWangShuai }}
                        </div>
                        <br />
                        <div>
                          <b>万物类象：</b>
                          <div class="leixiang">
                            <div v-for="lx in item.leiXiang.length" :key="lx">
                              {{ item.leiXiang.split("#")[lx] }}
                            </div>
                          </div>
                        </div>
                        <div class="index">
                          {{ item.id }}
                        </div>
                      </el-card>
                    </div>
                  </div>
                  <div v-show="data.length === 0" class="null">
                    暂无数据
                  </div>

                </div>
              </div>

            </el-card>
          </el-col>

          <el-col :span="3">
            <el-card shadow="never" class="card2">
              <div class="header">
                更多
              </div>

              <div class="selest">
                <div v-for="item in mores" :key="item" class="item">
                  <router-link :to="item.link">
                    <div class="title">
                      <Icon type="ios-arrow-dropright" />
                      {{ item.title }}
                    </div>
                  </router-link>

                </div>

                <div class="plan">
                  敬请期待 ...
                </div>
              </div>
            </el-card>
          </el-col>

        </el-row>

      </div>

    </div>
  </div>
</template>

<style scoped lang="less" src="@/css/culture/bagua.scss"></style>
